
#===============================================================================
#
#         FILE:  PodX.pm
#
#  DESCRIPTION:  
#
#        FILES:  ---
#         BUGS:  ---
#        NOTES:  ---
#       AUTHOR:  Beomsu Chang (bschang), <bschang@phya.yonsei.ac.kr>
#      COMPANY:  
#      VERSION:  1.0
#      CREATED:  
#     REVISION:  ---
#===============================================================================

use strict;
use WebTranslate::PodParser;
use WebTranslate::Unit;
use IO::Scalar;

package WebTranslate::PodX; {
use Object::InsideOut qw/WebTranslate::Source/;


########## Declare Data Members ##########
sub _init	:Init {
	my ( $self, $args ) = @_;

	$self->TagNameHash	( {Unit => 'UNIT',	Meta => 'META', Comment => 'C',} );

	$self->TagTemplate ({
		ToStr	=>sub { 'X<WT_'.$_[0].' '.$_[1].'>' },
		FromStr	=>sub { ($_[0]=~/X<WT_(\S*)"\s*(.*)>"/) },
	});
    
	$self->TagRegx	( qr/^X<WT_(UNIT|META|C)\s*(.*?)>/ 	);
	$self->TagStr   ( 'X<WT_%%TAG%% %%ATTR%%>' 			);
	$self->AttrRegx	( qr/(\S+)="(.*?)"/ 				); 
	$self->AttrStr	( '%%KEY%%=%%VALUE%%'				);
	$self->AttributeTemplate ({
		ToStr	=>sub { my $at=@_;join ',', map{$_.'="'.$at->[$_].'"'} keys %$at; },
		FromStr	=>sub { my %at; $at{$1}=$2 while /(\w*)="(.*?)"/g; \%at; },
	});
}

} # End of package
1;
